home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50a Issue 142 (CD142a) (August 1998).iso / handson / supercede / Knowodys / Projects / Primes / StarterFiles / Primes.java < prev    next >
Encoding:
Java Source  |  1997-08-13  |  759 b   |  35 lines

  1.  
  2. import java.awt.Graphics;
  3.  
  4. public class Primes extends java.applet.Applet {
  5.     int high = 0;
  6.  
  7.     public Primes () {
  8.     }
  9.  
  10.    public void init()
  11.     {
  12.     /* reads parameter from HTML page and converts it to an integer from a String */
  13.  
  14.         Integer i = new Integer(0);
  15.         high = i.parseInt(getParameter("highest"));
  16.     }
  17.  
  18.     public void paint(Graphics g)
  19.     {
  20.         int row = 1, col=1;
  21.  
  22.         boolean isPrime;
  23.  
  24. /* TODO: Create an outer loop that makes theNum go from 1 to high (adding 1 every iteration). Also write an inner loop that checks each value of theNum from 2 up to theNum/2 */
  25.  
  26.  
  27.             if (isPrime) {
  28.                 /* if theNum is prime, print it using g. This is inside the outer loop.    */
  29.             }
  30.  
  31.     }
  32. }
  33.  
  34.  
  35.